package top.wzmyyj.zymk.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import top.wzmyyj.zymk.model.db.dao.FavorDb;
import top.wzmyyj.zymk.model.db.dao.HistoryDb;
import top.wzmyyj.zymk.model.db.dao.SearchHistoryDb;

import top.wzmyyj.zymk.greendao.gen.FavorDbDao;
import top.wzmyyj.zymk.greendao.gen.HistoryDbDao;
import top.wzmyyj.zymk.greendao.gen.SearchHistoryDbDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig favorDbDaoConfig;
    private final DaoConfig historyDbDaoConfig;
    private final DaoConfig searchHistoryDbDaoConfig;

    private final FavorDbDao favorDbDao;
    private final HistoryDbDao historyDbDao;
    private final SearchHistoryDbDao searchHistoryDbDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        favorDbDaoConfig = daoConfigMap.get(FavorDbDao.class).clone();
        favorDbDaoConfig.initIdentityScope(type);

        historyDbDaoConfig = daoConfigMap.get(HistoryDbDao.class).clone();
        historyDbDaoConfig.initIdentityScope(type);

        searchHistoryDbDaoConfig = daoConfigMap.get(SearchHistoryDbDao.class).clone();
        searchHistoryDbDaoConfig.initIdentityScope(type);

        favorDbDao = new FavorDbDao(favorDbDaoConfig, this);
        historyDbDao = new HistoryDbDao(historyDbDaoConfig, this);
        searchHistoryDbDao = new SearchHistoryDbDao(searchHistoryDbDaoConfig, this);

        registerDao(FavorDb.class, favorDbDao);
        registerDao(HistoryDb.class, historyDbDao);
        registerDao(SearchHistoryDb.class, searchHistoryDbDao);
    }
    
    public void clear() {
        favorDbDaoConfig.clearIdentityScope();
        historyDbDaoConfig.clearIdentityScope();
        searchHistoryDbDaoConfig.clearIdentityScope();
    }

    public FavorDbDao getFavorDbDao() {
        return favorDbDao;
    }

    public HistoryDbDao getHistoryDbDao() {
        return historyDbDao;
    }

    public SearchHistoryDbDao getSearchHistoryDbDao() {
        return searchHistoryDbDao;
    }

}
